package qj.tool.jna;

import qj.tool.jna.User32.CURSORINFO;
import qj.util.ThreadUtil;

import com.sun.jna.examples.win32.W32API;

public class Test {
	public static void main(String[] args) {
//		User32
		User32 user32 = User32.INSTANCE;
		
		while (true) {
			CURSORINFO ci = new CURSORINFO();
			ci.cbSize = new W32API.DWORD((long)ci.size());
			user32.GetCursorInfo(ci);
			System.out.println(ci.hCursor.toString());
//			CURSORINFO[] pCursorInfo = {null};
//			user32.GetCursorInfo(pCursorInfo);
//			System.out.println(pCursorInfo[0]);
			
			
//			System.out.println(Native.toString(user32.GetCursor().lpCursorName));
			ThreadUtil.sleep(1000);
		}
	}
	
//	public static interface User32 extends com.sun.jna.platform.win32.User32 {
//
//	    User32 INSTANCE = (User32) Native.loadLibrary("user32", User32.class, W32API.DEFAULT_OPTIONS);
//	    boolean GetCursorInfo(CURSORINFO pCursorInfo);
////	    HCURSOR GetCursor();
//	    public static class CURSORINFO extends Structure {
//	    	
//	    	public DWORD   cbSize;
//	    	public DWORD   flags;
//	    	public HCURSOR hCursor;
//	    	public POINT   ptScreenPos;
//
//	}
}
